//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package test.test;

import java.util.Scanner;

public class test1 {
	public test1() {
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.print("输入月份：");
		int month = sc.nextInt();
		System.out.print("输入价格：");
		double flyMoney = (double)sc.nextInt();
		System.out.print("选择类型（0：经济舱，1：头等舱）：");
		int classify = sc.nextInt();
		double money = flyTicket(flyMoney, month, classify);
		System.out.println("您机票的价格为：" + money);
	}

	public static double flyTicket(double flyMoney, int month, int classify) {
		if (month >= 5 && month <= 10) {
			if (classify == 1) {
				return flyMoney * 0.9;
			} else if (classify == 0) {
				return flyMoney * 0.85;
			} else {
				System.out.println("您输入的不是经济舱或头等舱");
				return (double)0.0F;
			}
		} else if (month >= 1 && month <= 4 || month >= 10 && month <= 12) {
			if (classify == 1) {
				return flyMoney * 0.7;
			} else if (classify == 0) {
				return flyMoney * 0.65;
			} else {
				System.out.println("您输入的不是经济舱或头等舱");
				return (double)0.0F;
			}
		} else {
			System.out.println("您输入的月份不存在");
			return (double)0.0F;
		}
	}
}
